xen.git
17 years agovt-d: workaround for Mobile Series 4 Chipset
Keir Fraser [Thu, 19 Feb 2009 10:59:43 +0000 (10:59 +0000)]
vt-d: workaround for Mobile Series 4 Chipset

Incorporated VT-d workaround for a sighting on Intel Mobile Series 4
chipset found in Linux iommu.  The sighting is the chipset is not
reporting write buffer flush capability correctly.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
17 years agopygrub: fix for NetBSD
Keir Fraser [Thu, 19 Feb 2009 10:53:46 +0000 (10:53 +0000)]
pygrub: fix for NetBSD

Signed-off-by: Frank van der Linden <frank.vanderlinden@sun.com>
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agox86: Fix xen panic when offlining a CPU.
Keir Fraser [Wed, 18 Feb 2009 08:59:26 +0000 (08:59 +0000)]
x86: Fix xen panic when offlining a CPU.

Also, fix a typo in a message. 'irq' => 'vector'

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years agovtd: fix/cleanup minor issues with multi-page qinval support
Keir Fraser [Wed, 18 Feb 2009 08:57:56 +0000 (08:57 +0000)]
vtd: fix/cleanup minor issues with multi-page qinval support

Remove MAX_QINVAL_PAGES.  Rely on whoever changes NUM_QINVAL_PAGES to
change corresponding IQA_REG_QS value also.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
17 years agovtd, x86: Fix dom0 boot crash
Keir Fraser [Wed, 18 Feb 2009 08:56:31 +0000 (08:56 +0000)]
vtd, x86: Fix dom0 boot crash

Signed-off-by: Allen Kay allen.m.kay@intel.com
17 years agoia64: Fix the missing msi.h by accident, and enhance the check
Keir Fraser [Wed, 18 Feb 2009 08:53:52 +0000 (08:53 +0000)]
ia64: Fix the missing msi.h by accident, and enhance the check
for one BUG_ON.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
17 years agoAdd missing pv_ops Linux buildconfig file.
Keir Fraser [Tue, 17 Feb 2009 11:20:18 +0000 (11:20 +0000)]
Add missing pv_ops Linux buildconfig file.

17 years agopvSCSI, xend: add new device assignment mode
Keir Fraser [Tue, 17 Feb 2009 11:19:55 +0000 (11:19 +0000)]
pvSCSI, xend: add new device assignment mode

You can use "host" mode by specifying keyword "host" as virtual scsi
device. Following is usage example.

    xm scsi-attach 1 2:0:3:4 host

In this case, all LUNs under host=2 are attached to guest domain 1.
The channel=0, target=3 and lun=4 are ignored.

Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com>
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Jun Kamada <kama@jp.fujitsu.com>
17 years agoxend: Update VCPUs_live
Keir Fraser [Tue, 17 Feb 2009 11:13:34 +0000 (11:13 +0000)]
xend: Update VCPUs_live

XendConfig.py said about VCPUs_live as follows.

 -- the number of VCPUs currently up, as reported by Xen.

But the value of VCPUs_live always is 1 till xm vcpu-set get
executed.  This patch updates VCPUs_live by using online_vcpus.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agoxend: Improve information-gathering processing of SCSI devices by using lsscsi
Keir Fraser [Tue, 17 Feb 2009 11:12:50 +0000 (11:12 +0000)]
xend: Improve information-gathering processing of SCSI devices by using lsscsi

In the case of xm scsi-attach, when the SCSI devices are specified in
HCTL form or device name form, the processing is faster.

If lsscsi command is not installed, the processing works by using
information of /sys as before.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agoBUILD: Add option to build the Xen pvops git tree.
Keir Fraser [Tue, 17 Feb 2009 11:11:17 +0000 (11:11 +0000)]
BUILD: Add option to build the Xen pvops git tree.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
17 years agoia64: Enhance vt-d support for ia64.
Keir Fraser [Tue, 17 Feb 2009 11:10:00 +0000 (11:10 +0000)]
ia64: Enhance vt-d support for ia64.

This patch targets for enhancing vt-d support for ia64.
1. reserve enough memory for building dom0 vt-d page table.
2. build 1:1 vt-d page table according to system's mem map.
3. enable vt-d interrupt support for ia64.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Acked-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agoxenpm tool: add average C state residency
Keir Fraser [Tue, 17 Feb 2009 11:08:31 +0000 (11:08 +0000)]
xenpm tool: add average C state residency

Signed-off-by: Yu Ke <ke.yu@intel.com>
17 years agovtd: clean up of __iommu_flush_iec()
Keir Fraser [Tue, 17 Feb 2009 11:07:29 +0000 (11:07 +0000)]
vtd: clean up of __iommu_flush_iec()

remove bogus global variable to make it local variable.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agopassthrough: fix MSI-X table fixmap allocation
Keir Fraser [Tue, 17 Feb 2009 11:06:16 +0000 (11:06 +0000)]
passthrough: fix MSI-X table fixmap allocation

Currently, msix table pages are allocated a fixmap page per vector,
the available fixmap pages will be depleted when assigning devices
with large number of vectors.  This patch fixes it, and a bug that
prevents cross-page MSI-X table from working properly

It now allocates msix table fixmap pages per device, if the table
entries of two msix vectors share the same page, it will only be
mapped to fixmap once. A ref count is maintained so that it can
be unmapped when all the vectors are freed.

Also changes the meaning of msi_desc->mask_base from the va of msix
table start to the va of the target entry. The former one is currently
buggy (it always maps the first page but msix can support up to 2048
entries) and can't handle separately allocated pages.

Signed-off-by: Qing He <qing.he@intel.com>
17 years agoFix typos in xendomains script.
Keir Fraser [Tue, 17 Feb 2009 11:04:08 +0000 (11:04 +0000)]
Fix typos in xendomains script.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agoMerge with ext/ia64/xen-unstable.hg
Keir Fraser [Tue, 17 Feb 2009 11:01:05 +0000 (11:01 +0000)]
Merge with ext/ia64/xen-unstable.hg

17 years ago[IA64] remove a warning.
Isaku Yamahata [Fri, 13 Feb 2009 10:11:38 +0000 (19:11 +0900)]
[IA64] remove a warning.

This patch remove the following warning.

mca.c:1928: warning: unused variable 'irq'

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years ago[IA64] remove the warning.
Isaku Yamahata [Fri, 13 Feb 2009 10:07:17 +0000 (19:07 +0900)]
[IA64] remove the warning.

iommu.c:891: warning: implicit declaration of function 'free_irq_vector'

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years ago[IA64] fix relinquish_memory()
Isaku Yamahata [Fri, 13 Feb 2009 10:03:37 +0000 (19:03 +0900)]
[IA64] fix relinquish_memory()

This patch fixes the following panic.

(XEN) Assertion 'entry->prev->next == entry' failed, line 170, file xen-unstable.hg/xen/include/xen/list.h
(XEN) Xen BUG at xen-unstable.hg/xen/include/xen/list.h:170
(XEN) FIXME: implement ia64 dump_execution_state()
(XEN)
(XEN) Call Trace:
(XEN)  [<f400000004104670>] show_stack+0x90/0xb0
(XEN)                                 sp=f0000002f64cfbf0 bsp=f0000002f64c9918
(XEN)  [<f400000004105180>] dump_stack+0x30/0x50
(XEN)                                 sp=f0000002f64cfdc0 bsp=f0000002f64c98f8
(XEN)  [<f400000004064ac0>] __bug+0x70/0xa0
(XEN)                                 sp=f0000002f64cfdc0 bsp=f0000002f64c98c8
(XEN)  [<f400000004031290>] free_domheap_pages+0x380/0x700
(XEN)                                 sp=f0000002f64cfdc0 bsp=f0000002f64c9868
(XEN)  [<f4000000040ac470>] domain_page_flush_and_put+0x1c0/0x550
(XEN)                                 sp=f0000002f64cfdc0 bsp=f0000002f64c9820
(XEN)  [<f4000000040ac990>] domain_put_page+0x190/0x530
(XEN)                                 sp=f0000002f64cfdd0 bsp=f0000002f64c97b0
(XEN)  [<f4000000040ad060>] zap_domain_page_one+0x330/0x530
(XEN)                                 sp=f0000002f64cfde0 bsp=f0000002f64c9710
(XEN)  [<f4000000040ad570>] dom0vp_zap_physmap+0x70/0xe0
(XEN)                                 sp=f0000002f64cfdf0 bsp=f0000002f64c96d8
(XEN)  [<f4000000040838f0>] do_dom0vp_op+0x320/0x7b0
(XEN)                                 sp=f0000002f64cfdf0 bsp=f0000002f64c9690
(XEN)  [<f400000004002e60>] fast_hypercall+0x170/0x310
(XEN)                                 sp=f0000002f64cfe00 bsp=f0000002f64c9690
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 2:
(XEN) Xen BUG at xen-unstable.hg/xen/include/xen/list.h:170
(XEN) ****************************************
(XEN)
(XEN) Reboot in five seconds...
(XEN) Debugging connection not set up.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agox86: Clean up vpt-align patch.
Keir Fraser [Fri, 13 Feb 2009 09:48:56 +0000 (09:48 +0000)]
x86: Clean up vpt-align patch.

Also disable by default if not specified in domain config. Otherwise
the feature would be incorrectly enabled for old saved domain images.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agohvm: Align periodic vpts.
Keir Fraser [Fri, 13 Feb 2009 09:43:06 +0000 (09:43 +0000)]
hvm: Align periodic vpts.

Aligned periodic vpts can improve the HVM guest power consumption a
lot, especially while the guest using high HZ such as 1000HZ.

Signed-off-by: Wei Gang <gang.wei@intel.com>
17 years agoxenapi: Correct some syntax errors in xen/xend/XendAPI.py
Keir Fraser [Fri, 13 Feb 2009 09:38:16 +0000 (09:38 +0000)]
xenapi: Correct some syntax errors in xen/xend/XendAPI.py

- usage of undefined variables in error cases (invalid handle
specified) in methods VBD_create, VTPM_destroy, event_unregister
- not imported module 'uuid' in method debug_create results in an
exception

Signed-off-by: Lutz Dube <Lutz.Dube@fujitsu-siemens.com>
17 years agoiommu: Fix interrupt setup.
Keir Fraser [Fri, 13 Feb 2009 09:36:58 +0000 (09:36 +0000)]
iommu: Fix interrupt setup.

Set vector_to_iommu[vector] before calling request_vector since null
pointer exceptions occur.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years ago[XSM][FLASK] basic documentation and a type cast error for x86_64
Keir Fraser [Fri, 13 Feb 2009 09:33:58 +0000 (09:33 +0000)]
[XSM][FLASK] basic documentation and a type cast error for x86_64

  - A simple txt howto based on previous list discussions and observations
  - A oneliner patch to address a compiler type cast error for x86_64

Signed-off-by: George S. Coker, II <gscoker@alpha.ncsc.mil>
17 years agoxendomains: clean up output formatting
Keir Fraser [Fri, 13 Feb 2009 09:32:02 +0000 (09:32 +0000)]
xendomains: clean up output formatting

Show errors in the way they are coming from xm command only (no usage
is printed now). Watchdog_wm() has been changed for not showing dots
in the process of shutting down domains and if an error occurs it
prints target domain, operation (save/restore/migrate etc.) and reason
of failure in more user-friendly way.

Signed-off-by: Michal Novotny <minovotn@redhat.com>
17 years agox86 hvm: Allow restore of old images with different segment attribute format.
Keir Fraser [Fri, 13 Feb 2009 09:29:52 +0000 (09:29 +0000)]
x86 hvm: Allow restore of old images with different segment attribute format.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years ago[IA64] shrink ia64 struct page_info.
Isaku Yamahata [Fri, 13 Feb 2009 02:23:16 +0000 (11:23 +0900)]
[IA64] shrink ia64 struct page_info.

This patch is the ia64 counter part of 19107:0858f961c77a,
19132:5848b49b74fc and 19136:162cdb596b9a.
This patch shrink ia64 struct page_info and rearrange its members.

The shrinking is made compile time option in config.h with default off
becuase physical address size is architected to 50bit by ia64
and mfn isn't always addressed by 32bits with 16KB page size.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years ago[IA64] use page_list_head and related stuff.
Isaku Yamahata [Fri, 13 Feb 2009 02:22:59 +0000 (11:22 +0900)]
[IA64] use page_list_head and related stuff.

Use page_list_head and stuff for consistency with x86 code.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agomerge with xen-unstable.hg
Isaku Yamahata [Fri, 13 Feb 2009 02:22:28 +0000 (11:22 +0900)]
merge with xen-unstable.hg

17 years ago[IA64] MCA: Avoid calling xmcalloc from interrupt handler
Isaku Yamahata [Fri, 13 Feb 2009 01:56:01 +0000 (10:56 +0900)]
[IA64] MCA: Avoid calling xmcalloc from interrupt handler

This patch fixes to avoid calling xmalloc() from the interrupt handler.
Calling xmalloc() with interrupt disabled triggers the following
BUG_ON().
> (XEN) Xen BUG at xmalloc_tlsf.c:548

Signed-off-by: Kazuhiro Suzuki <kaz@jp.fujitsu.com>
17 years agovtd: move the snoop control detection out of acpi_dmar_init()
Keir Fraser [Thu, 12 Feb 2009 10:54:17 +0000 (10:54 +0000)]
vtd: move the snoop control detection out of acpi_dmar_init()
where the capability value is not initialized thus we may
get random value.

Signed-off-by: Xin, Xiaohui<xiaohui.xin@intel.com>
17 years agoxm save: Display help text if bad options specified.
Keir Fraser [Thu, 12 Feb 2009 10:53:10 +0000 (10:53 +0000)]
xm save: Display help text if bad options specified.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agorombios: fix int15/86h (wait for microseconds)
Keir Fraser [Thu, 12 Feb 2009 10:52:05 +0000 (10:52 +0000)]
rombios: fix int15/86h (wait for microseconds)

The bcc compiler generates wrong stack pointer offset of a local
variable within ASM code if another local variable is declared
later.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
17 years agoCleanup naming for ia64 and x86 interrupt handling functions
Keir Fraser [Thu, 12 Feb 2009 10:48:55 +0000 (10:48 +0000)]
Cleanup naming for ia64 and x86 interrupt handling functions

- Append '_IRQ' to AUTO_ASSIGN, NEVER_ASSIGN, and FREE_TO_ASSIGN
- Rename {request,setup}_irq to {request,setup}_irq_vector
- Rename free_irq to release_irq_vector
- Add {request,setup,release}_irq wrappers for their
  {request,setup,release}_irq_vector counterparts
- Added generic irq_to_vector inline for ia64
- Changed ia64 to use the new naming scheme

Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agocpufreq: fix the build
Keir Fraser [Wed, 11 Feb 2009 16:36:59 +0000 (16:36 +0000)]
cpufreq: fix the build
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: cpufreq get_cur_val adjustment
Keir Fraser [Wed, 11 Feb 2009 13:07:45 +0000 (13:07 +0000)]
x86: cpufreq get_cur_val adjustment

c/s 19149 update cpufreq get_cur_val logic to avoid cross processor
call. However, to avoid null drv_data pointer, we adjust some logic in
this patch to keep advantage of c/s 19149 and at same time to avoid
null drv_data pointer.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
17 years agocpufreq cmdline handling
Keir Fraser [Wed, 11 Feb 2009 10:47:24 +0000 (10:47 +0000)]
cpufreq cmdline handling

c/s 19147 adjust cpufreq cmdline handling, this patch is a complement
to c/s 19147.

In this patch:
1. add common para (governor independent para) handling;
2. change governor dependent para handling method, governor dependent
para will only be handled by the handler of that governor (not by all
governors);
3. add userspace governor dependent para handling;
4. change para name 'threshold' of ondemand governor to 'up_threshold'
since ondemand has only 'up_threshold', and conservative governor (will be
implemented later) has both 'up_threshold' and 'down_threshold';
5. change some coding style (c/s 19147, drivers/cpufreq/cpufreq.c) to
keep coordination with original drivers/cpufreq/cpufreq.c coding style;
(originally this file is ported from linux, we partly use linux coding style)

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
17 years agoxend: PCIQuirk`__devIsUnconstrained refers to an undeclared variable if
Keir Fraser [Wed, 11 Feb 2009 10:45:34 +0000 (10:45 +0000)]
xend: PCIQuirk`__devIsUnconstrained refers to an undeclared variable if
/etc/xen/xend-pci-permissive.sxp doesn't exist.

Signed-off-by: David Edmondson <dme@sun.com>
17 years agopciif: Fix typo in constant definition.
Keir Fraser [Wed, 11 Feb 2009 10:45:19 +0000 (10:45 +0000)]
pciif: Fix typo in constant definition.

Signed-off-by: David Edmondson <dme@sun.com>
17 years agoblktap: Fix check_gcrypt
Keir Fraser [Wed, 11 Feb 2009 10:44:42 +0000 (10:44 +0000)]
blktap: Fix check_gcrypt

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
17 years agox86_64: Ensure enough space for allocator bitmap after relocated Xen image.
Keir Fraser [Wed, 11 Feb 2009 10:41:45 +0000 (10:41 +0000)]
x86_64: Ensure enough space for allocator bitmap after relocated Xen image.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: mce: Provide extended physical CPU info.
Keir Fraser [Tue, 10 Feb 2009 05:51:00 +0000 (05:51 +0000)]
x86: mce: Provide extended physical CPU info.

Provide extended physial CPU info for the sake of dom0 MCE handling.
This information includes <cpu,core,thread> info for all logical CPUs,
cpuid information from all of them, and initial MSR values for a few
MSRs that are important to MCE handling.

Signed-off-by: Frank van der Linden <Frank.Vanderlinden@Sun.COM>
17 years agovtd: fix compilation error on ia64 for 19185:1eb6afcad849.
Keir Fraser [Tue, 10 Feb 2009 05:47:00 +0000 (05:47 +0000)]
vtd: fix compilation error on ia64 for 19185:1eb6afcad849.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
17 years agovtd: adding support for multiple queued invalidation pages
Keir Fraser [Mon, 9 Feb 2009 14:23:51 +0000 (14:23 +0000)]
vtd: adding support for multiple queued invalidation pages

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
17 years agominios: fix p2m on x86
Keir Fraser [Mon, 9 Feb 2009 14:22:07 +0000 (14:22 +0000)]
minios: fix p2m on x86

15675:bf85b467ee89 Fixed p2m on x86_64, but instead broke it on x86.

Signed-off-by: Samuel Thibault <samuel.thibaut@ens-lyon.org>
17 years ago[IA64] fix compilation error of iommu.c
Keir Fraser [Mon, 9 Feb 2009 12:50:12 +0000 (12:50 +0000)]
[IA64] fix compilation error of iommu.c

This patch fixes the following compilation error on ia64
caused by 19178:4fcf4c9c9751.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agoRevert 19178:4fcf4c9c9751ccb8ed
Keir Fraser [Mon, 9 Feb 2009 12:46:26 +0000 (12:46 +0000)]
Revert 19178:4fcf4c9c9751ccb8ed

Breaks boot on every box under the sun it seems.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years ago[IA64] compilation fix of xentrace.
Keir Fraser [Fri, 6 Feb 2009 11:18:45 +0000 (11:18 +0000)]
[IA64] compilation fix of xentrace.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agox86: Clean up page-mfn conversion macros to allow better override by shadow code.
Keir Fraser [Fri, 6 Feb 2009 11:15:28 +0000 (11:15 +0000)]
x86: Clean up page-mfn conversion macros to allow better override by shadow code.

Also fix is_xen_heap_mfn() to deal with invalid MFNs.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxenctx: print x86_32 context on x86_64
Keir Fraser [Fri, 6 Feb 2009 10:43:58 +0000 (10:43 +0000)]
xenctx: print x86_32 context on x86_64

Although x86_64 context covers x86_32, I think it's easy to watch.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years agoBetter separate IOAPIC management from interrupt vector management
Keir Fraser [Fri, 6 Feb 2009 10:42:26 +0000 (10:42 +0000)]
Better separate IOAPIC management from interrupt vector management

Don't automatically update ioapic_irq array when allocating vectors.
Only do so when actually allocating IOAPIC irqs.  Also move some
IOAPIC specific defines to io_apic.c.

Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
17 years agox86: Move interrupt vector management from io_apic.c to irq.c
Keir Fraser [Fri, 6 Feb 2009 10:40:00 +0000 (10:40 +0000)]
x86: Move interrupt vector management from io_apic.c to irq.c

Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
17 years agox86: ->shutdown() in free_irq() should be passed vector, not irq.
Keir Fraser [Fri, 6 Feb 2009 10:39:10 +0000 (10:39 +0000)]
x86: ->shutdown() in free_irq() should be passed vector, not irq.

Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
17 years agoCleanup IOMMU interrupt setup
Keir Fraser [Fri, 6 Feb 2009 10:36:23 +0000 (10:36 +0000)]
Cleanup IOMMU interrupt setup
- Check for errors when allocating interrupt vectors
- Clean up if interrupt allocation failed
- Make sure that the allocated vector is not reused

Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
17 years agolibxenctrl: adds xc_domain_unbind_msi_irq to libxc.
Keir Fraser [Thu, 5 Feb 2009 15:28:09 +0000 (15:28 +0000)]
libxenctrl: adds xc_domain_unbind_msi_irq to libxc.

The function is needed to unbind MSI/MSI-X on transition from D3hot
state to D0 state.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
17 years agoFix PCI passthrough for devices w/o iomem.
Keir Fraser [Thu, 5 Feb 2009 15:08:53 +0000 (15:08 +0000)]
Fix PCI passthrough for devices w/o iomem.

From: Manuel Bouyer <bouyer@netbsd.org>
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agox86: Use per-domain irq-to-vector array when mapping GSIs
Keir Fraser [Thu, 5 Feb 2009 12:20:18 +0000 (12:20 +0000)]
x86: Use per-domain irq-to-vector array when mapping GSIs

Using the per-domain array enables single MSI vectors to be mapped.

Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
17 years agoxenctx support for 64-bit HVM guests
Keir Fraser [Thu, 5 Feb 2009 12:17:24 +0000 (12:17 +0000)]
xenctx support for 64-bit HVM guests
Now that we can easily find EFER.LMA, xenctx can detect 64-bit HVM
VCPUs

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agolibxc support for the new partial-HVM-save domctl.
Keir Fraser [Thu, 5 Feb 2009 12:17:08 +0000 (12:17 +0000)]
libxc support for the new partial-HVM-save domctl.
This includes making the pagetable walker in xc_pagetab.c behave
correctly for 32-bit and 64-bit HVM guests.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agoRemove uses of DECLARE_BITMAP in the public HVM save format headers
Keir Fraser [Thu, 5 Feb 2009 12:16:53 +0000 (12:16 +0000)]
Remove uses of DECLARE_BITMAP in the public HVM save format headers
and replace them with open-coded equivalents.  DECLARE_BITMAP is
not exported to user-space consumers of the Xen headers.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agoAdd a new domctl to get a single record from the HVM save context
Keir Fraser [Thu, 5 Feb 2009 12:16:28 +0000 (12:16 +0000)]
Add a new domctl to get a single record from the HVM save context

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agox86: recover pat value for bsp after S3 resume.
Keir Fraser [Thu, 5 Feb 2009 12:14:09 +0000 (12:14 +0000)]
x86: recover pat value for bsp after S3 resume.

host pat is set to cover all memory types by Xen, which is
necessary to support guest mtrr/pat, especially when device
is passthroughed with VT-d. However pat on bsp is not=20
recovered which could make assigned device defunct after S3
resume

Signed-off-by Kevin Tian <kevin.tian@intel.com>

17 years agox86: solve spinlock bug in s3 cpufreq path.
Keir Fraser [Thu, 5 Feb 2009 12:13:25 +0000 (12:13 +0000)]
x86: solve spinlock bug in s3 cpufreq path.

Signed-off-by Kevin Tian <kevin.tian@intel.com>

17 years agox86: EPT cleanups.
Keir Fraser [Thu, 5 Feb 2009 12:12:34 +0000 (12:12 +0000)]
x86: EPT cleanups.

Signed-off-by: Xin, Xiaohui <xiaohui.xin@intel.com>
17 years agoAdd a page_info flag to indicate whether free pages need a TLB flush
Keir Fraser [Thu, 5 Feb 2009 12:09:10 +0000 (12:09 +0000)]
Add a page_info flag to indicate whether free pages need a TLB flush
on next use.

Apart from teh small performance gain of this, my primary motivation
is to avoid TLB flushes very early in boot, when the system is not yet
properly set up for cross-TLB shootdowns.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Throw away .eh_frame exception-handling sections. Otherwise they
Keir Fraser [Thu, 5 Feb 2009 08:28:00 +0000 (08:28 +0000)]
x86: Throw away .eh_frame exception-handling sections. Otherwise they
can fail the build by requiring linking against discarded .exit.*
sections.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoRemove cpumask for page_info struct.
Keir Fraser [Wed, 4 Feb 2009 15:29:51 +0000 (15:29 +0000)]
Remove cpumask for page_info struct.

This makes TLB flushing on page allocation more conservative, but the
flush clock should still save us most of the time (page freeing and
alloc'ing tends to happen in batches, and not necesasrily close
together). We could add some optimisations to the flush filter if this
does turn out to be a significant overhead for some (useful)
workloads.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Clean up PV guest LDT handling.
Keir Fraser [Wed, 4 Feb 2009 15:08:46 +0000 (15:08 +0000)]
x86: Clean up PV guest LDT handling.
 1. Do not touch deferred_ops in invalidate_shadow_ldt(), as we may
 not always be in a context where deferred_ops is valid.
 2. Protected the shadow LDT with a lock, now that mmu updates are not
 protected by the per-domain lock.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Rename cached current from 'v' to 'curr' in a few places.
Keir Fraser [Wed, 4 Feb 2009 14:46:47 +0000 (14:46 +0000)]
x86: Rename cached current from 'v' to 'curr' in a few places.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: No need to flush TLBs on free_page_type() as we no longer trust
Keir Fraser [Wed, 4 Feb 2009 14:28:13 +0000 (14:28 +0000)]
x86: No need to flush TLBs on free_page_type() as we no longer trust
the linear pagetable mapping (we use it but we double check it).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Relocate Multiboot module command-line strings.
Keir Fraser [Wed, 4 Feb 2009 13:27:17 +0000 (13:27 +0000)]
x86: Relocate Multiboot module command-line strings.

Missed this in the original patch.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxend: fix vncconsole option
Keir Fraser [Wed, 4 Feb 2009 12:43:11 +0000 (12:43 +0000)]
xend: fix vncconsole option
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoEliminate some special page list accessors
Keir Fraser [Wed, 4 Feb 2009 12:01:47 +0000 (12:01 +0000)]
Eliminate some special page list accessors

Since page_list_move_tail(), page_list_splice_init(), and
page_list_is_eol() are only used by relinquish_memory(), and that
function can easily be changed to use more generic accessors, just
eliminate them altogether.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agoxend: Delay before SIGKILL qemu
Keir Fraser [Wed, 4 Feb 2009 12:01:05 +0000 (12:01 +0000)]
xend: Delay before SIGKILL qemu

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
17 years agovtd: Add a boot parameter option for snoop control capability for VT-d.
Keir Fraser [Wed, 4 Feb 2009 12:00:06 +0000 (12:00 +0000)]
vtd: Add a boot parameter option for snoop control capability for VT-d.
The default is to use snoop control.

Signed-off-by: Xin, Xiaohui <xiaohui.xin@intel.com>
17 years agoxm: Improve xm error if booted native
Keir Fraser [Wed, 4 Feb 2009 11:58:25 +0000 (11:58 +0000)]
xm: Improve xm error if booted native

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
17 years agodocs: Add detach console note to xm man page
Keir Fraser [Wed, 4 Feb 2009 11:57:47 +0000 (11:57 +0000)]
docs: Add detach console note to xm man page

I've been asked too many times about a hint in xm man page on how to
'detach' from a guest console - aka Ctrl+]

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
17 years agoXendAPIStore - do not remove non-existent item
Keir Fraser [Wed, 4 Feb 2009 11:57:17 +0000 (11:57 +0000)]
XendAPIStore - do not remove non-existent item

If list is searched and item not found, then don't attempt to delete
the item.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
17 years agox86: avoid redundant TLB flushes
Keir Fraser [Tue, 3 Feb 2009 18:14:19 +0000 (18:14 +0000)]
x86: avoid redundant TLB flushes

While in some places the guest requested flushes were already folded
into the deferred ops, this wasn't done consistently.

Also avoid using an uninitialized variable, even if doing so has no
correctness issue.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agox86: misc adjustments to acpi-cpufreq
Keir Fraser [Tue, 3 Feb 2009 18:13:55 +0000 (18:13 +0000)]
x86: misc adjustments to acpi-cpufreq

Avoid the call to check_freq() by default, since that function may
spin up to 1ms on certain systems without indicating any kind of severe
failure. This matches similar behavior in Linux.

Avoid doing a cross processor call in get_cur_val() if the current CPU
has its bit set in the mask passed in. Also use the local variable
'cpu' consistently, allowing to remove another local variable.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agocpufreq: attach __exit to the (unused) cpufreq governor exit handlers
Keir Fraser [Tue, 3 Feb 2009 18:13:22 +0000 (18:13 +0000)]
cpufreq: attach __exit to the (unused) cpufreq governor exit handlers

... in order to make them disappear from the final image. Of course
they could as well be removed altogether, but I assumed that whoever
added them had a reason to do so.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agoConsolidate cpufreq cmdline handling
Keir Fraser [Tue, 3 Feb 2009 18:12:51 +0000 (18:12 +0000)]
Consolidate cpufreq cmdline handling

... by moving as much of the option processing into cpufreq code as is
possible, by folding the cpufreq_governor option into the cpufreq one
(the governor name, if any, must be specified as the first thing after
the separator following "cpufreq=xen"), and by allowing each
governor to have an option processing routine.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agox86: Relocate Multiboot structures where we know they will be
Keir Fraser [Tue, 3 Feb 2009 18:11:03 +0000 (18:11 +0000)]
x86: Relocate Multiboot structures where we know they will be
accessible. GRUB2 seems to like to stick them really high sometimes
(just below 4GB).

The 32-bit C code framework that this sets up can also be used for
other stuff in future:
 * early cmdline parsing
 * relocating multiboot modules so they too are guaranteed accessible

Its interaction with normal Xen start-of-day, and with the 16-bit
assembly trampoline, needs a bit of thought.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoia64: fix compilation error
Keir Fraser [Tue, 3 Feb 2009 14:06:51 +0000 (14:06 +0000)]
ia64: fix compilation error

This patch fixes the following compilation error.
Since struct page_list_head is defined in mm.h, sched.h needs mm.h.
Other circular inclusions are sorted out.

> In file included from xen/include/asm-ia64/linux-xen/asm/smp.h:50,
>                  from xen/include/linux/smp.h:5,
>                  from xen/include/asm-ia64/linux/topology.h:33,
>                  from xen/include/asm-ia64/linux-xen/linux/gfp.h:6,
>                  from xen/include/asm/mm.h:11,
>                  from xen/include/xen/mm.h:90,
>                  from viosapic.c:35:
> xen/include/xen/sched.h:174: error: field page_list has incomplete
> type
> xen/include/xen/sched.h:175: error: field xenpage_list has
> incomplete type

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agox86/shadow: struct page_info's type_info is now unsigned long,
Keir Fraser [Tue, 3 Feb 2009 14:03:32 +0000 (14:03 +0000)]
x86/shadow: struct page_info's type_info is now unsigned long,

hence local variables of type u32 (and the more such with misleading
names) must no longer be used.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agoFix 'debug ?= y' to actually enable debug build.
Keir Fraser [Mon, 2 Feb 2009 09:21:04 +0000 (09:21 +0000)]
Fix 'debug ?= y' to actually enable debug build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years ago[IA64] Fix populate-on-demand stub.
Isaku Yamahata [Mon, 2 Feb 2009 02:11:36 +0000 (11:11 +0900)]
[IA64] Fix populate-on-demand stub.

A return value of 1 is meant to inform decrease_reservation() that
everything has been taken care of by the PoD code and it doesn't need
to call guest_remove_page().

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
17 years agox86: page_info cleanups.
Keir Fraser [Fri, 30 Jan 2009 11:33:27 +0000 (11:33 +0000)]
x86: page_info cleanups.
 1. No reason for i386 not to use the same definitions as x64
 2. No need for shadow_page_info names to hang around.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agopage_alloc: try to put heap control structures on the target node
Keir Fraser [Fri, 30 Jan 2009 11:16:52 +0000 (11:16 +0000)]
page_alloc: try to put heap control structures on the target node

This also neatly eliminates (in certain cases) the need to reserve a
page between nodes, as the heap control structures will never be freed
and thus can serve as the needed separator.

It also adds an additonal fallback attempting to make use of the
wasted tail of a (group of) page(s) used for the _heap array by putting the
avail array there if it fits.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agopage_alloc: properly honor MAX_ORDER in init_heap_pages()
Keir Fraser [Fri, 30 Jan 2009 11:14:23 +0000 (11:14 +0000)]
page_alloc: properly honor MAX_ORDER in init_heap_pages()

The previous check was flawed in that it checked
- for a single bit to be set instead of a range of bits to be clear
- a machine address against a mask supposed to be used on MFNs.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agopass-through: drop lock before calling xfree() on error path
Keir Fraser [Fri, 30 Jan 2009 11:13:55 +0000 (11:13 +0000)]
pass-through: drop lock before calling xfree() on error path

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agoamd-iommu: drop locks before printing error messages
Keir Fraser [Fri, 30 Jan 2009 11:13:32 +0000 (11:13 +0000)]
amd-iommu: drop locks before printing error messages

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agoamd-iommu: obtain page_alloc_lock before traversing a domain's page list
Keir Fraser [Fri, 30 Jan 2009 11:13:06 +0000 (11:13 +0000)]
amd-iommu: obtain page_alloc_lock before traversing a domain's page list

From all I can tell, this doesn't violate lock ordering as other
places call heap allocation functions from inside hd->mapping_lock.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agox86: re-arrange struct page_info members
Keir Fraser [Fri, 30 Jan 2009 11:10:43 +0000 (11:10 +0000)]
x86: re-arrange struct page_info members

By combining the overlay fields that are 8 bytes long (on x86-64) into
a union separate from the one used for the 4 byte wide fields, no
unnecessary padding will be inserted while at the same time avoiding
to use __attribute__((__packed__)) on any of the sub-structures (which
risks misaligning structure members without immediately noticing).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agox86-64: use MFN also for next_shadow link
Keir Fraser [Fri, 30 Jan 2009 11:09:44 +0000 (11:09 +0000)]
x86-64: use MFN also for next_shadow link

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agox86-64: fold shadow_page_info fields into page_info
Keir Fraser [Fri, 30 Jan 2009 11:08:06 +0000 (11:08 +0000)]
x86-64: fold shadow_page_info fields into page_info

... combining the list entry members of both structures and removing
the artificial 'mbz' member (shadow code must keep the real underlying
member 'count_info' at zero for the lifetime of pages use as shadows).

This also fixes a latent issue with u.inuse._domain not getting
explicitly cleared before returning shadow pages to the domain heap -
it just so happened that this member turned out to be zero in all
(normal?) cases when a shadow page ends its life (but there were
neither build nor run-time assertions that this would actually be the
case). The bug got exposed by a subsequent patch changing the order of
fields in struct page_info.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agox86: Better bzimage_headroom() crash fix.
Keir Fraser [Fri, 30 Jan 2009 11:04:24 +0000 (11:04 +0000)]
x86: Better bzimage_headroom() crash fix.
Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
17 years agox86-64: use MFNs for linking together pages on lists
Keir Fraser [Fri, 30 Jan 2009 11:03:28 +0000 (11:03 +0000)]
x86-64: use MFNs for linking together pages on lists

Unless more than 16Tb are going to ever be supported in Xen, this will
allow reducing the linked list entries in struct page_info from 16 to
8 bytes.

This doesn't modify struct shadow_page_info, yet, so in order to meet
the constraints of that 'mirror' structure the list entry gets
artificially forced to be 16 bytes in size. That workaround will be
removed in a subsequent patch.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agox86_64: Remove bogus extra do_xsm_op from hypercall_args_table
Keir Fraser [Fri, 30 Jan 2009 10:51:01 +0000 (10:51 +0000)]
x86_64: Remove bogus extra do_xsm_op from hypercall_args_table
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>